$(function() {
	$('#js_submit').click(function() {
		var id = $(this).data('id'),
			api = '/support/authentication/' + id + '/audit';
		Confirm('身份认证', '是否认证通过？', null, [ {
			text : '通过',
			className: 'auth-ok',
			event : function() {
				$('#js_submit').button('loading');
				$.post(api, {
					isAudit : true
				}, handle);
			}
		}, {
			text : '不通过',
			className: 'auth-cancel',
			event : function() {
				$('#js_submit').button('loading');
				$.post(api, {
					isAudit : false
				}, handle);
			}
		} ]);
	});
	
	function handle(res){
		$('#js_submit').button('reset');
		if (res.status == 'ok') {
			success(res.message);
		} else {
			error(res.message);
		}
	}
});